#ifndef COREPLUGIN_H
#define COREPLUGIN_H

#include "plugin.hpp"
#include <boost/thread.hpp>

namespace pland
{
class Plugin
{
public:
    Plugin(UserC_Plugin* plugin, void (*wrapup)(UserC_Plugin *), Plugin_Id id);
    virtual ~Plugin();
    bool start();
    bool stop();
    bool pause();
    UserC_Plugin * getUserPlugin();
    Plugin_Id getId();
private:

    typedef enum
    {
        RUNNING,
        PAUSED,
        TERMINATED
    } Plugin_State;

    void start_();
    void (*wrapup_)(UserC_Plugin*);

    Plugin_Id id_;
    Plugin_State state_;
    UserC_Plugin *plugin_;
    boost::thread thread_;
};
}
#endif // COREPLUGIN_H
